from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
from zope.app.schema.vocabulary import IVocabularyFactory
from zope.interface import implements
from my315ok.xtinfocontent import xtinfocontentMessageFactory as _

class_unit=[
('chuzu','chuzu',_(u'chuzu')),
('qiugou','qiugou',_(u'qiugou')),
('qiuzu','qiuzu',_(u'qiuzu')),
('zhuanrang','zhuanrang',_(u'zhuanrang')),
('qita','qita',_(u'qita')),
  ]
class_terms = [
    SimpleTerm(value, token, title) for value, token, title in class_unit
]
navtag=[
('xt','xtlocal',_(u'xtlocal')),
('cn','china',_(u'china')),
('hn','hunan',_(u'hunan')),
  ]
navtag_terms = [
    SimpleTerm(value, token, title) for value, token, title in navtag
]
position=[
('tl','topleft',_(u'top_left')),
('tr','topright',_(u'top_right')),
('tc','topcenter',_(u'top_center')),
('ml','middleleft',_(u'middle_left')),
('mr','middleright',_(u'middle_right')),
('mc','middlecenter',_(u'middle_center')),
('bl','bottomleft',_(u'bottom_left')),
('br','bottomright',_(u'bottom_right')),
('bc','bottomcenter',_(u'bottom_center')),
  ]
position_terms = [
    SimpleTerm(value, token, title) for value, token, title in position
]


class ClassinfoCategoryVocabulary(object):
    
    """ Ad Unit sizes """

    implements(IVocabularyFactory)

    def __call__(self, context):
        return SimpleVocabulary(class_terms)


ClassinfoCategoryVocabularyFactory = ClassinfoCategoryVocabulary()

class AdPositionVocabulary(object):
    
    """ Ad position """

    implements(IVocabularyFactory)

    def __call__(self, context):
        return SimpleVocabulary(position_terms)


AdPositionVocabularyFactory = AdPositionVocabulary()

class NavTagVocabulary(object):
    
    """ navlink tag """

    implements(IVocabularyFactory)

    def __call__(self, context):
        return SimpleVocabulary(navtag_terms)


NavTagVocabularyFactory = NavTagVocabulary()

